package com.forum.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.forum.dao.SubjectCoursesTabDao;
import com.forum.entity.SubjectCoursesTabEntity;
import com.forum.entity.view.SubjectCoursesTabView;
import com.forum.service.SubjectCoursesTabService;
import com.forum.utils.MyQuery;
import com.forum.utils.PageUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SubjectCoursesTabServiceImpl extends ServiceImpl<SubjectCoursesTabDao, SubjectCoursesTabEntity> implements SubjectCoursesTabService {

    /*@Override
    public List<XuekekechengVO> selectListVO(Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public XuekekechengVO selectVO(Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectVO(wrapper);
    }*/

    @Override
    public List<SubjectCoursesTabView> selectListView(Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public SubjectCoursesTabView selectView(Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectView(wrapper);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<SubjectCoursesTabEntity> page = this.selectPage(
                new MyQuery<SubjectCoursesTabEntity>(params).getPage(),
                new EntityWrapper<SubjectCoursesTabEntity>()
        );
        return new PageUtils(page);
    }
    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<SubjectCoursesTabEntity> wrapper) {
        Page<SubjectCoursesTabView> page =new MyQuery<SubjectCoursesTabView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<Map<String, Object>> selectValue(Map<String, Object> params, Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params, Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectTimeStatValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectGroup(Map<String, Object> params, Wrapper<SubjectCoursesTabEntity> wrapper) {
        return baseMapper.selectGroup(params, wrapper);
    }
}
